#include <iostream>

using namespace std;

int main(int argc, char * argv[])
{
  float A,rez,st;
  int N;
  std::cout <<"A=";
  std::cin >> A;
  std::cout <<"N=";
  std::cin >> N;
  if (N > 0)
  {
    st = 1;
    rez = 0;
    for(int i = 1; i <= N; i++)
    {
      st = st * A;
      rez = rez + st;
    }
    std::cout<<rez;
  }
  system("PAUSE>>null");
  return 0;
}
